import { Language } from "../../../../../extend/language/Language";
import { ImagesConst } from "../../../resource/ImagesConst";
import { PetProcessBar } from "../../pet/PetProcessBar";
import { ObjCreate } from "../../common/ObjCreate";
import { HTMLUtil } from "../../../../../com/gengine/utils/HTMLUtil";
type int = number;
//class MountGrowBars
    
    export  class MountGrowBars /* flash.display.Sprite */
    {
        constructor(arg1: int, arg2: int, arg3: int)
        {
            
            this._arrAttrGrow = Language.getString(70009).split(",");
            this._arrGrowBarClass = [ImagesConst.YellowBar10, ImagesConst.GreenBar10, ImagesConst.BlueBar10, ImagesConst.PurpleBar10, ImagesConst.RedBar10];
            this._arrGrowBar = [];
            this._gap = arg1;
            this._width = arg2;
            this._height = arg3;
            this.initView();
            return;
        }

        public get arrGrowBar(): Array<any>
        {
            if (this._arrGrowBar != []) 
            {
                return this._arrGrowBar;
            }
            return [];
        }

        /* internal  */initView(): void
        {
            var loc2=null;
            this.powerBar = new PetProcessBar(ImagesConst.YellowBar10, this._width, this._height);
            this.dexBar = new PetProcessBar(ImagesConst.GreenBar10, this._width, this._height);
            this.spiritBar = new PetProcessBar(ImagesConst.BlueBar10, this._width, this._height);
            this.boneBar = new PetProcessBar(ImagesConst.PurpleBar10, this._width, this._height);
            this.strongBar = new PetProcessBar(ImagesConst.RedBar10, this._width, this._height);
            this._arrGrowBar = [this.powerBar, this.dexBar, this.spiritBar, this.boneBar, this.strongBar];
            var loc1="";
            var loc3=this._arrAttrGrow.length;
            var loc4=[];
            var loc5=0;
            while (loc5 < loc3) 
            {
                loc1 = this._arrAttrGrow[loc5];
                loc2 = ObjCreate.createGTextField(loc1, 0, loc5 * (20 + this._gap), 60, 20, this);
                loc4.push(loc2);
                this._arrGrowBar[loc5].move(loc2.width + 3, 4 + loc5 * (20 + this._gap));
                this._arrGrowBar[loc5].progressBarClass = this._arrGrowBarClass[loc5];
                this._arrGrowBar[loc5].setValue(0, 0);
                this.addChild(this._arrGrowBar[loc5]);
                ++loc5;
            }
            loc4[0].toolTipData = HTMLUtil.addColor(Language.getString(70117), "#FFFFFF");
            loc4[1].toolTipData = HTMLUtil.addColor(Language.getString(70118), "#FFFFFF");
            loc4[2].toolTipData = HTMLUtil.addColor(Language.getString(70119), "#FFFFFF");
            loc4[3].toolTipData = HTMLUtil.addColor(Language.getString(70120), "#FFFFFF");
            loc4[4].toolTipData = HTMLUtil.addColor(Language.getString(70121), "#FFFFFF");
            return;
        }

        public setValue(arg1: Array<any>, arg2: int): void
        {
            var loc1=this.arrGrowBar.length;
            var loc2=0;
            while (loc2 < loc1) 
            {
                this.arrGrowBar[loc2].setValue(arg1[loc2], arg2);
                ++loc2;
            }
            return;
        }

        public clear(): void
        {
            this.powerBar.setValue(0, 0);
            this.dexBar.setValue(0, 0);
            this.spiritBar.setValue(0, 0);
            this.boneBar.setValue(0, 0);
            this.strongBar.setValue(0, 0);
            return;
        }

        /* internal */ /* var */_gap: int;

        /* internal */ /* var */_width: int;

        /* internal */ /* var */_height: int;

        /* internal */ /* var */_arrAttrGrow: Array<any>;

        /* internal */ /* var */_arrGrowBarClass: Array<any>;

        /* internal */ /* var */_arrGrowBar: Array<any>;

        public /* var */powerBar: PetProcessBar;

        public /* var */dexBar: PetProcessBar;

        public /* var */spiritBar: PetProcessBar;

        public /* var */boneBar: PetProcessBar;

        public /* var */strongBar: PetProcessBar;
    }
